//
//  JZHMyCollectTableViewCell.m
//  极致荟
//
//  Created by hetao on 14-5-14.
//  Copyright (c) 2014年 mac. All rights reserved.
//

#import "JZHMyCollectTableViewCell.h"

@implementation JZHMyCollectTableViewCell

- (void)awakeFromNib
{
    [self.headimge.layer setCornerRadius:6.0];
    [self.headimge.layer setMasksToBounds:YES];
}

- (IBAction)deletes:(id)sender
{
    if(self.deleteliset)
    {
        self.deleteliset();
    }
    
}

- (void)addCellData:(id)data
{
    self.name.text=[User defuceUser].name;
    [ImageCache imageUrl:[User defuceUser].userHeadImage UiImageview:self.headimge];
    NSDateFormatter *form=[[NSDateFormatter alloc]init];
    [form setDateFormat:@"MM月dd日 hh:mm"];
    
    if([data isKindOfClass:[JZHCommodity class]])
    {
        JZHCommodity *com=data;
         [ImageCache imageUrl:com.headimage UiImageview:self.contentimage];
        self.content.text=com.name;
        NSDate *date=[NSDate dateWithTimeIntervalSince1970:com.bigentime];
        self.cdate.text=[form stringFromDate:date];
        
    }else
    {
        JZHActivities *act=data;
        [ImageCache imageUrl:act.actimage UiImageview:self.contentimage];
          self.cdate.text=[form stringFromDate:act.actdate];
        self.content.text=act.acttile;
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
